﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using HCMessage.Model;
using HCBusiness;

namespace HealthCheckSystem.Controllers
{
    public class EnvironmentController : Controller
    {
        //
        // GET: /Environment/

        public ActionResult AddItem()
        {
            var envEntity = new EnvEntity();
            var env = new EnvironmentCategory();
            envEntity.EnvCtList = env.GetEnvironmentGategoryList();
            return View(envEntity);
        }
        [HttpPost]
        public ActionResult UpdateServerInfo(EnvEntity message)
        {
            var env = new EnvironmentCategory();
            env.UpdateItemInfo(message);
           // var result = null;
            var jr = new JsonResult { JsonRequestBehavior = JsonRequestBehavior.AllowGet, ContentType = "text/html" };
           // jr.Data = result;
            //jr.Data = "Success";
            return jr;
        }
        public ActionResult ItemDetail()
        {
            var itemList = new ItemReport();
            var env = new EnvironmentCategory();
            itemList = env.GetItemList();
            return View(itemList);
        }
    }
}
